/*
 * Copyright 2011 Sebastian Maurer
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package erepublik.dto;

import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Region extends IDNameType {

	private Buildings buildings = new Buildings();

	private Country country;
	
	private Integer citizenCount;
	
	@XmlElementWrapper(name="neighbours")
	@XmlElement(name="neighbour")
	private List<RegionCountry> neighbours;
	
	@XmlElement(name="raw-materials")
	private RawMaterial rawMaterials;

	public Country getCountry() {
		return country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}

	public Integer getCitizenCount() {
		return citizenCount;
	}

	public void setCitizenCount(Integer citizenCount) {
		this.citizenCount = citizenCount;
	}

	public List<RegionCountry> getNeighbours() {
		return neighbours;
	}

	public void setNeighbours(List<RegionCountry> neighbours) {
		this.neighbours = neighbours;
	}

	public RawMaterial getRawMaterials() {
		return rawMaterials;
	}

	public void setRawMaterials(RawMaterial rawMaterials) {
		this.rawMaterials = rawMaterials;
	}

	public List<DefenseSystem> getDefenseSystems() {
		return buildings.defenseSystems;
	}

	public List<Hospital> getHospitals() {
		return buildings.hospitals;
	}

	public void setDefenseSystems(List<DefenseSystem> defenseSystems) {
		this.buildings.defenseSystems = defenseSystems;
	}

	public void setHospitals(List<Hospital> hospitals) {
		this.buildings.hospitals = hospitals;
	} 

	@XmlAccessorType(XmlAccessType.FIELD)
	private static class Buildings {
		
		@XmlElementWrapper(name="defense-systems")
		@XmlElement(name="defense-system")
		private List<DefenseSystem> defenseSystems; 
		
		@XmlElementWrapper(name="hospitals")
		@XmlElement(name="hospital")
		private List<Hospital> hospitals;
		
	}
	
}
